package org.sean.framework.schedule.config;

import org.sean.framework.schedule.client.ScheduleClientImpl;
import org.sean.framework.schedule.endpoint.GreeterHttpController;
import org.sean.framework.schedule.endpoint.ScheduleJobsEndpoint;
import org.sean.framework.schedule.server.ScheduleServerImpl;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * 自动配置
 *
 * @author xielei
 */
@Configuration
@EnableConfigurationProperties
@Import(ScheduleClientImpl.class)
public class ServerAutoConfiguration {

    @Bean
    public ScheduleServerImpl scheduleServerImpl() {
        return new ScheduleServerImpl();
    }

    @Bean
    public ScheduleJobsEndpoint scheduleEndpoint() {
        return new ScheduleJobsEndpoint();
    }

    /**
     * @return GreeterHttpController
     * @deprecated {@link ScheduleJobsEndpoint}
     */
    @Bean
    public GreeterHttpController greeterHttpController() {
        return new GreeterHttpController();
    }

}
